<?php namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;

abstract class Controller extends BaseController
{

    use DispatchesCommands, ValidatesRequests;


    protected function bSuccess($msg, $closeCurrent = true, Array $data = [])
    {
        return response()->json([
            'statusCode' => '200',
            'message' => $msg,
            'tabid' => isset($data['tabid']) ? $data['tabid'] : '',
            'dialogid' => isset($data['dialogid']) ? $data['dialogid'] : '',
            'divid' => isset($data['divid']) ? $data['divid'] : '',
            'closeCurrent' => $closeCurrent,
            'forward' => isset($data['forward']) ? $data['forward'] : '',
            'forwardConfirm' => isset($data['forwardConfirm']) ? $data['forwardConfirm'] : '',
        ]);
    }
}
